from django.core.mail import EmailMessage
from  celery import shared_task

@shared_task
def send_mail(subject, body, to):
    message = EmailMessage(subject, body, to=[to])
    message.content_subtype = "html"
    message.send()
    return "邮件发送成功"
